<?php js_validate();?>
<style media="all" >
	table.data{
		border-collapse: collapse;
		width: 100%;
	}
	table.data tr td,table.data tr th{ font-size: 11px; font-family: Arial; padding: 5px;}
	table.data tr th{background-color: #f1f1f1;}
	h3,h4{padding: 0px; margin: 0px;}
</style>
<?php if(isset($data)){ ?>
<div style=" padding:4px; background-color:#FF9; border:2px solid #FC3; margin-bottom:5px; font-size:14px;">
<div style="float:left; text-align:left;">
<h3 style="font-size:20px;"><?php echo isset($data)?getCabang($data->bav_cabang):'';?></h3>
<h4><?php
	$b = explode("-",$data->bav_bulan);
	echo "Bulan : ".$this->bulan[$b[1]];
	echo ", Tahun : ".$b[0];

?></h4>
</div>
<div  style="float:right; width:270px; text-align:right; margin-top:12px;">
	<a href="<?php echo $own_links;?>" class="btn-simpan" style="padding:10px; text-decoration:none;"> Kembali </a>
    <a href="<?php echo $own_links."verifikasi/".$data->bav_id;?>" class="btn-simpan confirm" rel="Yakin Akan MengApprove data Ini ?" style="padding:10px; margin-left:20px; text-decoration:none;"> Verifikasi! </a>
</div>
<div class="clr"></div>
</div>
<?php } ?>

 <?php if(isset($items) && count($items) > 0){ ?>
<div style=" padding:4px; background-color:#FF9; border:2px solid #FC3; margin-bottom:5px; font-size:14px;">
<h2 style="font-size:15px; float:left;">Total Data : <?php echo count($items);?> data</h2>
<?php
	$jumlah = 0;
	foreach($items as $m){
		//$premi =  ($m->detail_uang_ptg * $m->detail_periode_ptg * $m->detail_tarif_premi)/100;
		$premi =  $m->detail_uang_ptg;
		$jumlah += $premi;
	}
?>
<h2 style="font-size:15px; float:right;">Total Uang Pertanggungan : <?php echo myNum($jumlah);?></h2>
<div class="clr"></div> 

</div>
<div class="clr"></div>
<?php } ?>

<table class="data">
	<tr>
		<th>No</th>  
        <th>Nama</th>
        <th>Alamat</th>
        <th>Tgl Akad</th>
        <th>Tgl Lahir</th>
        <th>USIA</th>
        <th>Periode Pertanggungan</th>
        <th>Uang Pertanggungan</th>
        <th>Tarif Premi (%)</th>    
        <?php if($this->bav_type == 'agunan'){?>
        	<th>Object Pertanggungan</th>
        <?php } ?>  
        <th>Premi</th>
	</tr>
    <?php if(isset($items) && count($items) > 0){
			$no=1;
			foreach($items as $r){
				$premi =  ($r->detail_uang_ptg * $r->detail_periode_ptg * $r->detail_tarif_premi)/100;
		?>
     		<tr>
            	<td><?php echo $no++;?></td>
                <td><?php echo $r->detail_nama;?></td>
                <td><?php echo $r->detail_alamat;?></td>                
                <td><?php echo myDate($r->detail_tglakad,"d/m/Y",false);?></td>
                <td><?php echo myDate($r->detail_tgllahir,"d/m/Y",false);?></td>
                <td align="center"><?php echo $r->detail_usia;?> Thn</td>
                <td align="center"><?php echo $r->detail_periode_ptg;?></td>
                <td><?php echo myNum($r->detail_uang_ptg);?></td>
                <td><?php echo $r->detail_tarif_premi;?></td>
                <?php if($this->bav_type == 'agunan'){?>
                <td><?php echo $r->detail_obj_ptg;?></td>
                <?php }?>
                <td><?php echo myNum($premi);?></td>
            </tr>   
    <?php } 
	}
	?>
</table>
